import request from "@/utils/request";

export const queryPageApi = (params) => {
  return request.get("/users", { params: params });
};

export const addApi = (data) => {
  return request.post("/users", data);
};

export const getByIdApi = (id) => {
  return request.get(`/users/${id}`);
};

export const updateApi = (data) => {
  return request.put("/users", data);
};

export const deleteApi = (id) => {
  return request.delete(`/users/${id}`);
};

export const getDeptListApi = () => {
  return request.get("/depts/list");
};

export const getRoleListApi = () => {
  return request.get("/roles/list");
};

// export const uploadImageApi = (file) => {
//   const formData = new FormData();
//   formData.append("image", file);
//   return request.post("/upload", formData);
// };
